{template 'common/header'}
<ul class="nav nav-tabs">
    <li>
        <a href="{php echo $this->createWebUrl('region', array('op' => 'list','id' => $id));}">返回</a>
    </li>
    <li>
        <a href="{php echo $this->createWebUrl('region', array('op' => 'rlist','id' => $id));}">查看房号</a>
    </li>
    <li class="active">
        <a href="#">编辑房号</a>
    </li>
</ul>
<form action="" class="form-horizontal form" method="post" role="form" enctype="multipart/form-data" onsubmit="return check(this);">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">编辑房号</h3>
        </div>
        <div class="panel-body">
            <div class="form-group">
                <label for="title" class="col-sm-2 control-label">房号名称</label>
                <div class="col-sm-4">
                    <input type='text' name='room' id='room' class="form-control" value="{$item['room']}" placeHolder="请输入房号名称" />
                </div>
            </div>
            <div class="form-group">
                <label for="linkway" class="col-sm-2 control-label">联系电话</label>
                <div class="col-sm-4">
                    <input type='text' name='mobile' class="form-control" id='mobile' value="{$item['mobile']}" placeHolder="请输入联系电话" />
                </div>
            </div>
            <div class="form-group">
                <label for="" class="col-sm-2 control-label"></label>
                <div class="col-sm-5">
                    <button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
                    <input type="hidden" name="token" value="{$_W['token']}" />
                </div>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript">
function check() {
    var mobile = $("#mobile").val();
    if (mobile == '') {
        alert('请填写真实手机号码');
        return false
    };
    if (!(/^1[3|5|7|4|5|8|][0-9]\d{4,8}$/.test(mobile))) {
        alert("不是完整的11位手机号或者正确的手机号前七位");
        return false;
    }
    var room = $("#room").val();
    if (room == '') {
        alert('请输入房号名称');
        return false;
    };
}
</script>
{template 'common/footer'}
